Execution Order
Manual     Reference     Scripting   
Unity Manual > Advanced > Execution Order

Execution Order

In Unity scripting, there are a number of event functions that get executed in a predetermined order as a script executes. This execution order is described below:

First Scene Load

These functions get called when a scene starts (once for each object in the scene).

Before the first frame update

Update Order

When you're keeping track of game logic and interactions, animations, camera positions, etc., there are a few different events you can use. The common pattern is to perform most tasks inside the Update() function, but there are also other functions you can use.

Rendering

Coroutine

Normal coroutine updates are run after the Update function returns. A coroutine is function that can suspend its execution (yield) until the given given YieldInstruction finishes. Different uses of Coroutines:

When Quitting

These functions get called on all the active objects in your scene, :

So in conclusion, this is the execution order for any given script:

Hints

Page last updated: 2010-11-03